#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

#define MAX(a, b) ((a) > (b) ? (a) : (b))

int largestCombination(int candidates[], int candidatesSize)
{
    int max = 0, i = 0, j = 0, len = 0;
    for (i = 0; i < 24; i++)
    {
        len = 0;
        for (j = 0; j < candidatesSize; j++)
        {
            if (candidates[j] & 1)
            {
                len++;
            }
            candidates[j] >>= 1;
        }
        max = MAX(max, len);
    }
    return max;
}

int main()
{
    int candidates[] = {16,17,71,62,12,24,14};
    int result = largestCombination(candidates, 7);
    printf("%d\n", result);
	return 0;
}